# Darknet object detection framework


MESSAGE(STATUS "Setting up DARKNET examples")


FILE (GLOB SRC_EXAMPLES *.cpp)
LIST (SORT SRC_EXAMPLES)


FOREACH (filename IN LISTS SRC_EXAMPLES)
	CMAKE_PATH (GET filename STEM stem)
	ADD_EXECUTABLE (${stem} ${filename})
	IF (DARKNET_USE_CUDA OR DARKNET_USE_ROCM)
		SET_TARGET_PROPERTIES (${stem} PROPERTIES CUDA_ARCHITECTURES "${DARKNET_CUDA_ARCHITECTURES}")
		SET_TARGET_PROPERTIES (${stem} PROPERTIES CUDA_SEPARABLE_COMPILATION OFF)
		SET_TARGET_PROPERTIES (${stem} PROPERTIES CUDA_RESOLVE_DEVICE_SYMBOLS OFF)
	ENDIF ()
	TARGET_LINK_LIBRARIES (${stem} PRIVATE darknet ${DARKNET_LINK_LIBS})
	INSTALL (TARGETS ${stem} DESTINATION bin)
ENDFOREACH ()
